<template>
  <view
    class="content1"
    :style="{
      'padding-top': height + 'px',
    }"
  >
    <view
      :style="{
        height: statusBarHeight + 'px',
      }"
    >
    </view>
    <view
      class="head"
      :style="{
        top: statusBarHeight + 'px',
      }"
    >
      <view class="head_left">
        <u-icon
          name="arrow-left"
          color="#EEEEEE"
          size="24"
          :bold="true"
          @click="toBack"
        ></u-icon>
      </view>
      <view class="text"> 历史记录 </view>
      <view
        class="head_right"
        @click="manage"
        :class="!flag ? 'head_right1' : ''"
      >
        {{ text }}
      </view>
    </view>

    <view class="tab_view">
      <u-tabs
        lineWidth="32"
        lineColor="#EEEEEE"
        :activeStyle="{
          color: '#EEEEEE',
          height: '48rpx',
          'line-height': '48rpx',
          'text-align': 'center',
          margin: '0 25rpx',
          'font-size': '34rpx',
        }"
        :inactiveStyle="{
          color: '#ADADAD',
          height: '48rpx',
          'line-height': '48rpx',
          'text-align': 'center',
          margin: '0 25rpx',
          'font-size': '34rpx',
        }"
        item-width="166"
        :list="list"
        :current="listIndex"
        @change="changeList"
      ></u-tabs>
    </view>
    <scroll-view
      :style="{
        height: scrollHeihgt + 'px',
      }"
      :scroll-y="true"
      @scroll="scroll"
      @scrolltolower="scrolltolower"
    >
      <!-- 用户 -->
      <User
        :flag="flag"
        v-if="listIndex == 0"
        :list="userList"
        @updateData="updateData"
        form="history"
      ></User>

      <!-- 微创 -->
      <view v-if="listIndex == 1" class="list_item">
        <view class="chooseIndex">
          <u-tabs
            :list="list1"
            lineWidth="0"
            lineColor="#f56c6c"
            :activeStyle="{
              color: '#EEEEEE',
              width: '144rpx',
              height: '56rpx',
              'line-height': '56rpx',
              'text-align': 'center',
              background: 'rgba(39,39,39,0.5)',
              'border-radius': '32rpx 32rpx 32rpx 32rpx',
              'font-size': '28rpx',
            }"
            :inactiveStyle="{
              width: '144rpx',
              height: '56rpx',
              'line-height': '56rpx',
              'text-align': 'center',
              background: 'rgba(39,39,39,0.5)',
              'border-radius': '32rpx 32rpx 32rpx 32rpx',
              color: '#ADADAD',
              'font-size': '28rpx',
            }"
            itemStyle="padding:0 20rpx; height: 56rpx'width: 144rpx"
            @change="change"
            :current="currentIndex"
          >
          </u-tabs>
        </view>
        <!-- 飞离洞 -->
        <view v-if="currentIndex == 0" style="padding-bottom: 30px">
          <commentBlock
            :flag="flag"
            :list="feiList.data"
            @updateDataFei="updateDataFei"
            moduleType="wei"
            from="history"
          ></commentBlock>
        </view>
        <!-- 灵感塔 -->
        <view v-if="currentIndex == 1">
          <lingDD
            :flag="flag"
            :list="lingList.data"
            @updateDataLing="updateDataLing"
            from="history"
          ></lingDD>
        </view>
        <!-- 诗心园 -->
        <view v-if="currentIndex == 2">
          <poem
            :isShow="false"
            :showName="true"
            :flag="flag"
            :list="shiList.data"
            @updateDataShi="updateDataShi"
            from="history"
          ></poem>
        </view>
        <!-- 文心岛 -->
        <view v-if="currentIndex == 3">
          <wenIsland
            :isShow="false"
            :currentIndex="2"
            :flag="flag"
            :familyList="wenList"
            @updateDataWen="updateDataWen"
            moduleType="wei"
            from="history"
          ></wenIsland>
        </view>
      </view>

      <!-- 星云共创 -->
      <view v-if="listIndex == 2" class="list_item">
        <view class="chooseIndex">
          <u-tabs
            :list="list2"
            lineWidth="0"
            lineColor="#f56c6c"
            :activeStyle="{
              color: '#EEEEEE',
              width: '144rpx',
              height: '56rpx',
              'line-height': '56rpx',
              'text-align': 'center',
              background: 'rgba(39,39,39,0.5)',
              'border-radius': '32rpx 32rpx 32rpx 32rpx',
              'font-size': '28rpx',
            }"
            :inactiveStyle="{
              width: '144rpx',
              height: '56rpx',
              'line-height': '56rpx',
              'text-align': 'center',
              background: 'rgba(39,39,39,0.5)',
              'border-radius': '32rpx 32rpx 32rpx 32rpx',
              color: '#ADADAD',
              'font-size': '28rpx',
            }"
            itemStyle="padding:0 20rpx; height: 56rpx'width: 144rpx"
            @change="xingChange"
            :current="currentIndex1"
          >
          </u-tabs>
        </view>
        <!-- 飞离洞 -->
        <view v-if="currentIndex1 == 0" style="padding-bottom: 30px">
          <commentBlock
            :flag="flag"
            :list="feiGongList.data"
            moduleType="gong"
            @updateDataGongFei="updateDataGongFei"
            from="history"
          ></commentBlock>
        </view>
        <!-- 灵感塔 -->
        <view v-if="currentIndex1 == 1">
          <!-- <lingDD :flag="flag" :showZanping="false"></lingDD> -->
          <lingDDXing
            :flag="flag"
            :whiteColor="true"
            :list="lingGongList.data"
            @updateDataGongLing="updateDataGongLing"
            from="history"
          ></lingDDXing>
        </view>
        <!-- 诗心园 -->
        <view
          v-if="currentIndex1 == 2"
          style="padding: 0 20px 30px 20px; box-sizing: border-box"
        >
          <poemXing
            :isShow="false"
            :blackColor="true"
            :showName="true"
            :flag="flag"
            :list="shiGongList.data"
            @updateDataGongShi="updateDataGongShi"
            from="history"
          ></poemXing>
        </view>
        <!-- 文心岛 -->
        <view v-if="currentIndex1 == 3">
          <wenIsland
            :isShow="false"
            :currentIndex="2"
            :flag="flag"
            :familyList="wenGongList"
            moduleType="gong"
            @updateDataGongWen="updateDataGongWen"
            from="history"
          ></wenIsland>
        </view>
        <!-- 星河 -->
        <view v-if="currentIndex1 == 4" style="padding-left: 34rpx">
          <star
            :showTitle="false"
            :whiteColor="true"
            :flag="flag"
            :list="xingGongList.data"
            @updateDataGongXing="updateDataGongXing"
            from="history"
          ></star>
        </view>
      </view>

      <!-- 课程 -->
      <Purchased
        v-if="listIndex == 3"
        :flag="flag"
        :showHead="false"
        :keChengList="keChengList"
        @updateDataKecheng="updateDataKecheng"
        @paging="paging"
        from="history"
        :fatherHeight="scrollHeihgt"
      ></Purchased>

      <!-- 导航仪 -->
      <navigatorS
        v-if="listIndex == 4"
        :flag="flag"
        style="padding: 30rpx; box-sizing: border-box"
        :isWhite="true"
        @updateDataDaoHang="updateDataDaoHang"
        :list="daohangList"
        from="history"
      ></navigatorS>

      <!-- 星河 -->
      <starList
        v-if="listIndex == 5"
        :isWhite="true"
        :flag="flag"
        @updateDataXingHe="updateDataXingHe"
        :list="xingheList"
        from="history"
      ></starList>

      <!-- 书院 -->
      <view v-if="listIndex == 6" class="list_item">
        <view class="chooseIndex">
          <u-tabs
            :list="list3"
            lineWidth="0"
            lineColor="#f56c6c"
            :activeStyle="{
              color: '#EEEEEE',
              width: '144rpx',
              height: '56rpx',
              'line-height': '56rpx',
              'text-align': 'center',
              background: 'rgba(39,39,39,0.5)',
              'border-radius': '32rpx 32rpx 32rpx 32rpx',
              'font-size': '28rpx',
            }"
            :inactiveStyle="{
              width: '144rpx',
              height: '56rpx',
              'line-height': '56rpx',
              'text-align': 'center',
              background: 'rgba(39,39,39,0.5)',
              'border-radius': '32rpx 32rpx 32rpx 32rpx',
              color: '#ADADAD',
              'font-size': '28rpx',
            }"
            itemStyle="padding:0 20rpx; height: 56rpx'width: 144rpx"
            @change="changeBook"
            :current="currentIndex2"
          >
          </u-tabs>
        </view>
        <!-- 书院简介 -->
        <view v-if="currentIndex2 == 0" style="padding: 30px 0">
          <introduce
            :flag="flag"
            @updateDataJianJie="updateDataJianJie"
            :list="jianjieList"
            from="history"
          ></introduce>
        </view>
        <!-- 老师介绍 -->
        <view v-if="currentIndex2 == 1" style="padding: 30px 0">
          <mentorItem
            :flag="flag"
            @updateDataLaoShi="updateDataLaoShi"
            :list="laoshiList"
            from="history"
          ></mentorItem>
        </view>
        <!-- 书院宗旨 -->
        <view v-if="currentIndex2 == 2" style="padding: 30px 0">
          <introduce
            :flag="flag"
            @updateDataZongzhi="updateDataZongzhi"
            :list="zongzhiList"
            from="history"
          ></introduce>
        </view>
        <!-- 新闻动态 -->
        <view v-if="currentIndex2 == 3" style="padding: 30px 0">
          <introduce
            :flag="flag"
            @updateDataDongtai="updateDataDongtai"
            :list="dongtaiList"
            from="history"
          ></introduce>
        </view>
      </view>

      <!-- 一田 -->
      <view v-if="listIndex == 7" class="list_item">
        <view class="chooseIndex">
          <u-tabs
            :list="list4"
            lineWidth="0"
            lineColor="#f56c6c"
            :activeStyle="{
              color: '#EEEEEE',
              width: '144rpx',
              height: '56rpx',
              'line-height': '56rpx',
              'text-align': 'center',
              background: 'rgba(39,39,39,0.5)',
              'border-radius': '32rpx 32rpx 32rpx 32rpx',
              'font-size': '28rpx',
            }"
            :inactiveStyle="{
              width: '144rpx',
              height: '56rpx',
              'line-height': '56rpx',
              'text-align': 'center',
              background: 'rgba(39,39,39,0.5)',
              'border-radius': '32rpx 32rpx 32rpx 32rpx',
              color: '#ADADAD',
              'font-size': '28rpx',
            }"
            itemStyle="padding:0 20rpx; height: 56rpx'width: 144rpx"
            @change="changeYitian"
            :current="currentIndex3"
          >
          </u-tabs>
        </view>
        <!-- 咨询问道 -->
        <view v-if="currentIndex3 == 0" style="padding: 30px 0">
          <seek
            :showNum="false"
            :flag="flag"
            @updateDataZiXun="updateDataZiXun"
            :list="zixunList"
            moduleType="zixun"
            from="history"
          ></seek>
        </view>

        <!-- 线下活动 -->
        <view v-if="currentIndex3 == 1" style="padding: 30px 0">
          <seek
            :flag="flag"
            :list="xianxiaList"
            @updateDataXianXia="updateDataXianXia"
            moduleType="xianxia"
            from="history"
          ></seek>
        </view>

        <!-- 研学感悟 -->
        <view v-if="currentIndex3 == 2" style="padding: 30px 0">
          <Perception
            :flag="flag"
            :list="yanxueList"
            @updateDataYanXue="updateDataYanXue"
            from="history"
          ></Perception>
        </view>
      </view>

      <!-- 人物 -->
      <peopleList
        v-if="listIndex == 8"
        :flag="flag"
        :backBg="true"
        style="padding: 30px 20px; box-sizing: border-box"
        @updateDataRenWu="updateDataRenWu"
        :list="RenWuList"
        from="history"
      ></peopleList>

      <!-- 图书 -->
      <books
        v-if="listIndex == 9"
        :flag="flag"
        :backBg="true"
        style="padding: 30px 20px; box-sizing: border-box"
        @updateDataTuShu="updateDataTuShu"
        :list="TuShuList"
        from="history"
      ></books>

      <!-- 今日更新 -->
      <updateToday
        v-if="listIndex == 10"
        :flag="flag"
        style="padding: 30px 20px; box-sizing: border-box"
        @updateDataJinRi="updateDataJinRi"
        :list="JinRiList.data"
        from="history"
      ></updateToday>

      <!-- 训练营 -->
      <training
        v-if="listIndex == 11"
        :flag="flag"
        :backBg="true"
        style="padding: 30px 20px; box-sizing: border-box"
        @updateDataXunLian="updateDataXunLian"
        :list="XunLianList"
        from="history"
      ></training>

      <!-- 游记 -->
      <travels
        v-if="listIndex == 12"
        :flag="flag"
        style="padding: 30px 20px; box-sizing: border-box"
        @updateDataYouJi="updateDataYouJi"
        :list="YouJiList"
        from="history"
      ></travels>
    </scroll-view>

    <floatingBall></floatingBall>
    
  </view>
</template>
    
<script>
import User from "./user.vue"; // 用户
import commentBlock from "@/components/commentBlock.vue"; //飞离洞
import wenIsland from "@/components/wenIsland.vue"; // 文心岛
import lingDD from "@/components/lingDD.vue"; // 微创-灵感塔
import lingDDXing from "@/components/search/lingDD.vue"; // 星云共创-灵感塔
import poem from "@/components/poem.vue"; // 微创-诗心园
import poemXing from "@/components/search/poem.vue"; // 星云共创-诗心园
import star from "@/components/search_co/star.vue"; //星河pcomponents/books
import navigatorS from "@/components/navigatorS.vue"; //导航仪
import Purchased from "@/pages/integral/Purchased.vue"; //课程
import starList from "@/components/starList.vue"; //星河
import introduce from "@/components/introduce.vue"; //书院简介
import mentorItem from "@/components/mentor_item.vue"; //老师介绍
import seek from "@/components/seek.vue"; //咨询问道
import Perception from "@/pages/field/components/Perception.vue"; //研学感悟
import peopleList from "@/pages/character/components/peopleList.vue"; //人物
import books from "@/components/books.vue"; //图书
import updateToday from "@/pages/home/components/updateToday.vue"; //今日更新
import training from "@/components/training.vue"; //训练营
import travels from "@/components/travels.vue"; //游记

export default {
  components: {
    User,
    commentBlock,
    lingDD,
    lingDDXing,
    wenIsland,
    poem,
    poemXing,
    star,
    Purchased,
    navigatorS,
    starList,
    introduce,
    mentorItem,
    seek,
    Perception,
    peopleList,
    books,
    updateToday,
    training,
    travels,
  },
  data() {
    return {
      statusBarHeight: 0,
      height: 0,
      scrollHeihgt: 0,
      currentIndex: 0,
      currentIndex1: 0,
      currentIndex2: 0,
      currentIndex3: 0,
      list: [
        {
          name: "用户",
          str: "yonghu",
        },
        {
          name: "微创",
          str: "weichuang",
        },
        {
          name: "星云共创",
          str: "xingyun",
        },
        {
          name: "课程",
          str: "kecheng",
        },
        {
          name: "导航仪",
          str: "daohangyi",
        },
        {
          name: "星河",
          str: "xinghe",
        },
        {
          name: "书院",
          str: "shuyuan",
        },
        {
          name: "一田",
          str: "yitian",
        },
        {
          name: "人物",
          str: "renwu",
        },
        {
          name: "图书",
          str: "tushu",
        },
        {
          name: "今日更新",
          str: "jinrigengxin",
        },
        {
          name: "训练营",
          str: "yunlianying",
        },
        {
          name: "游记",
          str: "youji",
        },
      ],
      list1: [
        {
          name: "飞离洞",
        },
        {
          name: "灵感塔",
        },
        {
          name: "诗心园",
        },
        {
          name: "文心岛",
        },
      ],
      list2: [
        {
          name: "飞离洞",
        },
        {
          name: "灵感塔",
        },
        {
          name: "诗心园",
        },
        {
          name: "文心岛",
        },
        {
          name: "星河",
        },
      ],
      list3: [
        {
          name: "书院简介",
        },
        {
          name: "老师介绍",
        },
        {
          name: "书院宗旨",
        },
        {
          name: "新闻动态",
        },
      ],
      list4: [
        {
          name: "咨询问道",
        },
        {
          name: "线下活动",
        },
        {
          name: "研学感悟",
        },
      ],
      current: 0,
      listIndex: 0,
      selected: "zuopin",
      flag: true,
      text: "管理",
      userList: {},
      feiList: {},
      lingList: {},
      shiList: {},
      wenList: {},
      feiGongList: {},
      lingGongList: {},
      shiGongList: {},
      wenGongList: {},
      xingGongList: {},
      keChengList: {},
      daohangList: {},
      xingheList: {},
      jianjieList: {},
      laoshiList: {},
      zongzhiList: {},
      zixunList: {},
      xianxiaList: {},
      RenWuList: {},
      yanxueList: {},
      TuShuList: {},
      JinRiList: {},
      XunLianList: {},
      YouJiList: {},
      dongtaiList: {},
      last_page: 0,
      page: 1,
    };
  },
  created() {
    const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度
    const windowHeihgt = statusBarHeight.windowHeight;
    this.statusBarHeight = statusBarHeight.statusBarHeight;
    this.$nextTick(() => {
      uni
        .createSelectorQuery()
        .select(".head")
        .boundingClientRect((data) => {
          this.height = data.height;
        })
        .exec();
    });

    this.$nextTick(() => {
      const query = uni.createSelectorQuery().in(this);
      query.select(".head").fields({
        size: true,
      });
      query.select(".tab_view").fields({
        size: true,
      });

      query.exec((data) => {
        let sum = 0;
        data.forEach((item) => {
          sum += item.height;
        });
        this.scrollHeihgt = windowHeihgt - sum - this.statusBarHeight;
      });
    });
    // 用户
    this.getUserHistory();
  },
  methods: {
    scroll() {},
    scrolltolower() {
      if (this.page == this.last_page || this.last_page == 0) {
      } else {
        this.page++;
        console.log(this.listIndex, "当前选项");
        if (this.listIndex == 0) {
          // 用户
          this.getUserHistory();
        } else if (this.listIndex == 1) {
          if (this.currentIndex == 0) {
            // 微创-飞离洞
            this.getFeiHistory();
          } else if (this.currentIndex == 1) {
            // 微创-灵感塔
            this.getLingHistory();
          } else if (this.currentIndex == 2) {
            // 微创-诗心园
            this.getShiHistory();
          } else if (this.currentIndex == 3) {
            // 微创-文心岛
            this.getWenHistory();
          }
        } else if (this.listIndex == 2) {
          // 共创-飞离洞
          // this.getFeiGongHistory();
          // this.currentIndex1 = e.index;
          if (this.currentIndex1 == 0) {
            // 共创-飞离洞
            this.getFeiGongHistory();
          } else if (this.currentIndex1 == 1) {
            // 共创-灵感塔
            this.getLingGongHistory();
          } else if (this.currentIndex1 == 2) {
            // 共创-诗心园
            this.getShiGongHistory();
          } else if (this.currentIndex1 == 3) {
            // 共创-文心岛
            this.getWenGongHistory();
          } else if (this.currentIndex1 == 4) {
            // 共创-星河
            this.getXingGongHistory();
          }
        } else if (this.listIndex == 3) {
          // 课程
          this.getKecheng();
        } else if (this.listIndex == 4) {
          // 导航仪
          this.getDaoHang();
        } else if (this.listIndex == 5) {
          // 星河
          this.getXinghe();
        } else if (this.listIndex == 6) {
          // 书院简介
          this.getJianJie();
        } else if (this.listIndex == 7) {
          // 咨询问道
          this.getZiXun();
        } else if (this.listIndex == 8) {
          // 人物
          this.getRenWu();
        } else if (this.listIndex == 9) {
          // 图书
          this.getTuShu();
        } else if (this.listIndex == 10) {
          // 今日更新
          this.getJinRi();
        } else if (this.listIndex == 11) {
          // 训练营
          this.getXunLian();
        } else if (this.listIndex == 12) {
          // 游记
          this.getYouJi();
        }
      }
      console.log("触发1");
    },
    toBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
    changeList(e) {
      this.page = 1;
      this.last_page = 0;
      console.log("aaaaaaa", e);
      this.listIndex = e.index;
      if (e.index == 0) {
        // 用户
        this.getUserHistory();
      } else if (e.index == 1) {
        // 微创-飞离洞
        this.getFeiHistory();
      } else if (e.index == 2) {
        // 共创-飞离洞
        this.getFeiGongHistory();
      } else if (e.index == 3) {
        // 课程
        this.getKecheng();
      } else if (e.index == 4) {
        // 导航仪
        this.getDaoHang();
      } else if (e.index == 5) {
        // 星河
        this.getXinghe();
      } else if (e.index == 6) {
        // 书院简介
        this.getJianJie();
      } else if (e.index == 7) {
        // 咨询问道
        this.getZiXun();
      } else if (e.index == 8) {
        // 人物
        this.getRenWu();
      } else if (e.index == 9) {
        // 图书
        this.getTuShu();
      } else if (e.index == 10) {
        // 今日更新
        this.getJinRi();
      } else if (e.index == 11) {
        // 训练营
        this.getXunLian();
      } else if (e.index == 12) {
        // 游记
        this.getYouJi();
      }
    },
    manage() {
      this.flag = !this.flag;
      if (this.flag == true) {
        this.text = "管理";
      } else {
        this.text = "完成";
      }
    },
    change(e) {
      this.page = 1;
      this.last_page = 0;
      console.log("eeeeeee", e);
      this.currentIndex = e.index;
      if (e.index == 0) {
        // 微创-飞离洞
        this.getFeiHistory();
      } else if (e.index == 1) {
        // 微创-灵感塔
        this.getLingHistory();
      } else if (e.index == 2) {
        // 微创-诗心园
        this.getShiHistory();
      } else if (e.index == 3) {
        // 微创-文心岛
        this.getWenHistory();
      }
    },
    xingChange(e) {
      this.page = 1;
      this.last_page = 0;
      console.log("eeeeeee", e);
      this.currentIndex1 = e.index;
      if (e.index == 0) {
        // 共创-飞离洞
        this.getFeiGongHistory();
      } else if (e.index == 1) {
        // 共创-灵感塔
        this.getLingGongHistory();
      } else if (e.index == 2) {
        // 共创-诗心园
        this.getShiGongHistory();
      } else if (e.index == 3) {
        // 共创-文心岛
        this.getWenGongHistory();
      } else if (e.index == 4) {
        // 共创-星河
        this.getXingGongHistory();
      }
    },
    changeBook(e) {
      this.page = 1;
      this.last_page = 0;
      console.log("eeeeeee", e);
      this.currentIndex2 = e.index;
      if (e.index == 0) {
        // 书院简介
        this.getJianJie();
      } else if (e.index == 1) {
        // 老师介绍
        this.getLaoShi();
      } else if (e.index == 2) {
        // 书院宗旨
        this.getZongzhi();
      } else if (e.index == 3) {
        // 新闻动态
        this.getDongtai();
      }
    },
    changeYitian(e) {
      this.page = 1;
      this.last_page = 0;
      console.log("eeeeeee", e);
      this.currentIndex3 = e.index;
      if (e.index == 0) {
        // 咨询问道
        this.getZiXun();
      } else if (e.index == 1) {
        // 线下活动
        this.getXianXia();
      } else if (e.index == 2) {
        // 研学感悟
        this.getYanXue();
      } else if (e.index == 3) {
      }
    },
    // 用户
    getUserHistory() {
      this.$http
        .historyUser({ page: this.page })
        .then((res) => {
          if (res.data.list.current_page == 1) {
            this.userList = res.data.list;
          } else {
            this.userList.data = this.userList.data.concat(res.data.list.data);
          }
          this.last_page = res.data.list.last_page;
          console.log(this.userList, "用户");

          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 微创-飞离洞
    getFeiHistory() {
      this.$http
        .historyWeiChuang({ type: 1, page: this.page })
        .then((res) => {
          // this.feiList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.feiList = res.data.list;
          } else {
            this.feiList.data = this.feiList.data.concat(res.data.list.data);
          }
          this.last_page = res.data.list.last_page;
          console.log(this.feiList, "微创-飞离洞");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 微创-灵感塔
    getLingHistory() {
      this.$http
        .historyWeiChuang({ type: 2, page: this.page })
        .then((res) => {
          // this.lingList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.lingList = res.data.list;
          } else {
            this.lingList.data = this.lingList.data.concat(res.data.list.data);
          }
          this.last_page = res.data.list.last_page;
          console.log(this.lingList, "微创-灵感塔");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 微创-诗心园
    getShiHistory() {
      this.$http
        .historyWeiChuang({ type: 3, page: this.page })
        .then((res) => {
          // this.shiList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.shiList = res.data.list;
          } else {
            this.shiList.data = this.shiList.data.concat(res.data.list.data);
          }
          this.last_page = res.data.list.last_page;
          console.log(this.shiList, "微创-诗心园");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 微创-文心岛
    getWenHistory() {
      this.$http
        .historyWeiChuang({ type: 4, page: this.page })
        .then((res) => {
          // this.wenList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.wenList = res.data.list;
          } else {
            this.wenList.data = this.wenList.data.concat(res.data.list.data);
          }
          this.last_page = res.data.list.last_page;
          console.log(this.wenList, "微创-文心岛");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 共创-飞离洞
    getFeiGongHistory() {
      this.$http
        .historyGongchuang({ type: 1, page: this.page })
        .then((res) => {
          // this.feiGongList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.feiGongList = res.data.list;
          } else {
            this.feiGongList.data = this.feiGongList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.feiGongList, "共创-飞离洞");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 共创-灵感塔
    getLingGongHistory() {
      this.$http
        .historyGongchuang({ type: 2, page: this.page })
        .then((res) => {
          // this.lingGongList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.lingGongList = res.data.list;
          } else {
            this.lingGongList.data = this.lingGongList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.lingGongList, "共创-灵感塔");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 共创-诗心园
    getShiGongHistory() {
      this.$http
        .historyGongchuang({ type: 3, page: this.page })
        .then((res) => {
          // this.shiGongList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.shiGongList = res.data.list;
          } else {
            this.shiGongList.data = this.shiGongList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.shiGongList, "共创-诗心园");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 共创-文心岛
    getWenGongHistory() {
      this.$http
        .historyGongchuang({ type: 4, page: this.page })
        .then((res) => {
          // this.wenGongList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.wenGongList = res.data.list;
          } else {
            this.wenGongList.data = this.wenGongList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.wenGongList, "共创-文心岛");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 共创-星河
    getXingGongHistory() {
      this.$http
        .historyGongchuang({ type: 5, page: this.page })
        .then((res) => {
          // this.xingGongList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.xingGongList = res.data.list;
          } else {
            this.xingGongList.data = this.xingGongList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.xingGongList, "共创-星河");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 课程
    getKecheng() {
      this.$http
        .historyKecheng({ page: this.page })
        .then((res) => {
          // this.keChengList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.keChengList = res.data.list;
          } else {
            this.keChengList.data = this.keChengList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.keChengList, "课程");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 父组件课程分页方法
    paging() {
      if (this.page == this.last_page || this.last_page == 0) {
      } else {
        this.page++;
        this.getKecheng();
      }
    },
    // 导航仪
    getDaoHang() {
      this.$http
        .historyDaohangyi({ page: this.page })
        .then((res) => {
          // this.daohangList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.daohangList = res.data.list;
          } else {
            this.daohangList.data = this.daohangList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.daohangList, "导航");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 星河
    getXinghe() {
      this.$http
        .historyXinghe({ page: this.page })
        .then((res) => {
          // this.xingheList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.xingheList = res.data.list;
          } else {
            this.xingheList.data = this.xingheList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.xingheList, "星河");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 书院简介
    getJianJie() {
      this.$http
        .historyShuYuan({ type: 1, page: this.page })
        .then((res) => {
          // this.jianjieList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.jianjieList = res.data.list;
          } else {
            this.jianjieList.data = this.jianjieList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.jianjieList, "书院简介");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 老师介绍
    getLaoShi() {
      this.$http
        .historyShuYuan({ type: 2, page: this.page })
        .then((res) => {
          // this.laoshiList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.laoshiList = res.data.list;
          } else {
            this.laoshiList.data = this.laoshiList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.laoshiList, "老师介绍");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 书院宗旨
    getZongzhi() {
      this.$http
        .historyShuYuan({ type: 3, page: this.page })
        .then((res) => {
          // this.zongzhiList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.zongzhiList = res.data.list;
          } else {
            this.zongzhiList.data = this.zongzhiList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.zongzhiList, "宗旨");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 新闻动态
    getDongtai() {
      this.$http
        .historyShuYuan({ type: 4, page: this.page })
        .then((res) => {
          // this.dongtaiList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.dongtaiList = res.data.list;
          } else {
            this.dongtaiList.data = this.dongtaiList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.dongtaiList, "宗旨");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 咨询问道
    getZiXun() {
      this.$http
        .historyYiTian({ type: 1, page: this.page })
        .then((res) => {
          // this.zixunList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.zixunList = res.data.list;
          } else {
            this.zixunList.data = this.zixunList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.zixunList, "咨询问道");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 线下活动
    getXianXia() {
      this.$http
        .historyYiTian({ type: 2, page: this.page })
        .then((res) => {
          // this.xianxiaList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.xianxiaList = res.data.list;
          } else {
            this.xianxiaList.data = this.xianxiaList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.xianxiaList, "线下活动");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 研学感悟
    getYanXue() {
      this.$http
        .historyYiTian({ type: 3, page: this.page })
        .then((res) => {
          // this.yanxueList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.yanxueList = res.data.list;
          } else {
            this.yanxueList.data = this.yanxueList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.yanxueList, "研学感悟");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 人物
    getRenWu() {
      this.$http
        .historyRenWu({ page: this.page })
        .then((res) => {
          // this.RenWuList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.RenWuList = res.data.list;
          } else {
            this.RenWuList.data = this.RenWuList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.RenWuList, "人物");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 图书
    getTuShu() {
      this.$http
        .historyTushu({ page: this.page })
        .then((res) => {
          // this.TuShuList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.TuShuList = res.data.list;
          } else {
            this.TuShuList.data = this.TuShuList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.TuShuList, "图书");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 今日更新
    getJinRi() {
      this.$http
        .historyJinRi({ page: this.page })
        .then((res) => {
          // this.JinRiList = res.data.list.data;
          if (res.data.list.current_page == 1) {
            this.JinRiList = res.data.list;
          } else {
            this.JinRiList.data = this.JinRiList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.JinRiList, "今日更新");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 训练营
    getXunLian() {
      this.$http
        .historyXunLian({ page: this.page })
        .then((res) => {
          // this.XunLianList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.XunLianList = res.data.list;
          } else {
            this.XunLianList.data = this.XunLianList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.XunLianList, "训练营");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    // 游记
    getYouJi() {
      this.$http
        .historyWeiChuang({ type: 6, page: this.page })
        .then((res) => {
          // this.YouJiList = res.data.list;
          if (res.data.list.current_page == 1) {
            this.YouJiList = res.data.list;
          } else {
            this.YouJiList.data = this.YouJiList.data.concat(
              res.data.list.data
            );
          }
          this.last_page = res.data.list.last_page;
          console.log(this.YouJiList, "游记");
          // for (let i = 0; i < res.data.list.length; i++) {
          //   this.list[i].clickable = false;
          // }
        })
        .catch((error) => {
          uni.$u.toast(error);
        });
    },
    updateData() {
      this.page = 1;
      this.last_page = 0;
      this.getUserHistory();
    },
    updateDataFei() {
      this.page = 1;
      this.last_page = 0;
      this.getFeiHistory();
    },
    updateDataLing() {
      this.page = 1;
      this.last_page = 0;
      this.getLingHistory();
    },
    updateDataShi() {
      this.page = 1;
      this.last_page = 0;
      this.getShiHistory();
    },
    updateDataWen() {
      this.page = 1;
      this.last_page = 0;
      this.getWenHistory();
    },
    updateDataGongFei() {
      this.page = 1;
      this.last_page = 0;
      this.getFeiGongHistory();
    },
    updateDataGongLing() {
      this.page = 1;
      this.last_page = 0;
      this.getLingGongHistory();
    },
    updateDataGongShi() {
      this.page = 1;
      this.last_page = 0;
      this.getShiGongHistory();
    },
    updateDataGongWen() {
      this.page = 1;
      this.last_page = 0;
      this.getWenGongHistory();
    },
    updateDataGongXing() {
      this.page = 1;
      this.last_page = 0;
      this.getXingGongHistory();
    },
    updateDataKecheng() {
      this.page = 1;
      this.last_page = 0;
      this.getKecheng();
    },
    updateDataDaoHang() {
      this.page = 1;
      this.last_page = 0;
      this.getDaoHang();
    },
    updateDataXingHe() {
      this.page = 1;
      this.last_page = 0;
      this.getXinghe();
    },
    updateDataJianJie() {
      this.page = 1;
      this.last_page = 0;
      this.getJianJie();
    },
    updateDataLaoShi() {
      this.page = 1;
      this.last_page = 0;
      this.getLaoShi();
    },
    updateDataZongzhi() {
      this.page = 1;
      this.last_page = 0;
      this.getZongzhi();
    },
    updateDataDongtai() {
      this.page = 1;
      this.last_page = 0;
      this.getDongtai();
    },

    updateDataZiXun() {
      this.page = 1;
      this.last_page = 0;
      this.getZiXun();
    },
    updateDataXianXia() {
      this.page = 1;
      this.last_page = 0;
      this.getXianXia();
    },
    updateDataYanXue() {
      this.page = 1;
      this.last_page = 0;
      this.getYanXue();
    },
    updateDataRenWu() {
      this.page = 1;
      this.last_page = 0;
      this.getRenWu();
    },
    updateDataTuShu() {
      this.page = 1;
      this.last_page = 0;
      this.getTuShu();
    },
    updateDataJinRi() {
      this.page = 1;
      this.last_page = 0;
      this.getJinRi();
    },
    updateDataXunLian() {
      this.page = 1;
      this.last_page = 0;
      this.getXunLian();
    },
    updateDataYouJi() {
      this.page = 1;
      this.last_page = 0;
      this.getYouJi();
    },
  },
};
</script>
    
<style scoped lang="scss">
.content1 {
  height: 100vh;
  // position: fixed;
  box-sizing: border-box;
  background: url("/static/images/index.png") no-repeat;
  background-size: 100% 100%;
  .slot-content {
    view {
      display: flex;
      justify-content: center;
    }
  }
}

.head {
  width: 100%;
  padding: 18rpx 30rpx 47rpx;
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 99;

  .head_left {
    position: absolute;
    left: 30rpx;
  }

  .head_right {
    position: absolute;
    right: 30rpx;
    color: #55b877;
  }

  .head_right1 {
    color: #eeeeee;
  }

  .text {
    font-size: 36rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: 400;
    color: #eeeeee;
  }
}

.tab_view {
  width: 100%;
}
.list_item {
  padding: 42rpx 0 0 0;
}
</style>